﻿@model OrderSystem.Models.OrderSystemUser


@{ 
   ViewBag.Title = "Login Page";
 }

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset style="width:480px; position: absolute; left: 30%; top: 30%;"> 
    @{
        if ((int) Session["LoginCounter"] < 5)
        {
            <legend align="left" style="font-weight: bold;"> Order Management System </legend>
            <p> 
                <table>
                    <tr>
                        <td align="right"> @Html.LabelFor(m => m.LoginName, "Name: ") </td> 
                        <td colspan="2"> 
                            @Html.TextBoxFor(m => m.LoginName, new {size = "60"})
                        </td>
                    </tr>
                    <tr>
                        <td />
                        <td colspan="2" height="20">
                            @Html.ValidationMessageFor(m => m.LoginName)
                        </td>
                    </tr>
                    <tr>
                        <td align="right"> @Html.LabelFor(m => m.Password, "Password: ") </td> 
                        <td colspan="2"> 
                            @Html.PasswordFor(m => m.Password, new {size = "60"})
                        </td>
                    </tr>
                    <tr>
                        <td />
                        <td colspan="2" height="20">
                            @Html.ValidationMessageFor(m => m.Password)
                        </td>
                    </tr>
                    <tr>
                        <td />
                        <td> <input id="UserCheckBox" type="checkbox" /> Remember user name </td> 
                        
                        <td align="right"> <input type="submit" value="Login" /> </td>
                    </tr>
                </table>
            </p>
        }
        else
        {
            <legend align="left" style="font-weight: bold;"> Warning Message </legend>
            <p> 
            User credentials were entered incorrectly. Page is locked for 10 minutes.
            <br/> Please try again leater.
            </p>
        }
    }
    </fieldset>
}
